﻿<Page
    x:Class="InfoHub.ExtendedStart"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:InfoHub"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{StaticResource StartBrush}">
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="VisualStateGroup">
    			<VisualStateGroup.Transitions>
    				<VisualTransition GeneratedDuration="0:0:.5">
    					<VisualTransition.GeneratedEasingFunction>
    						<ExponentialEase EasingMode="EaseInOut"/>
    					</VisualTransition.GeneratedEasingFunction>
    				</VisualTransition>
    			</VisualStateGroup.Transitions>
    			<VisualState x:Name="Loading">
    				<Storyboard>
    					<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke)" Storyboard.TargetName="ellipse">
    						<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
    					</ObjectAnimationUsingKeyFrames>
    					<ColorAnimation Duration="0" To="#FFDADADA" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="-125" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="0.995" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="progressRing" d:IsOptimized="True"/>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="NotLoading"/>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
        <Image x:Name="image" Source="Assets/SplashScreen.png" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" >
        	<Image.RenderTransform>
        		<CompositeTransform/>
        	</Image.RenderTransform>
        </Image>
        <ProgressRing x:Name="progressRing" Width="130"
                      Height="130"
                      HorizontalAlignment="Center"
                      VerticalAlignment="Center"
                      Foreground="{StaticResource SecondaryBrush}"
                      IsActive="True" Opacity="0" />
        <Ellipse x:Name="ellipse" Fill="#FFF4F4F5" HorizontalAlignment="Center" VerticalAlignment="Center" Height="29" Opacity="1" Stroke="Transparent" Width="200" RenderTransformOrigin="0.5,0.5">
            <Ellipse.RenderTransform>
                <CompositeTransform TranslateY="100"/>
            </Ellipse.RenderTransform>
        </Ellipse>
    </Grid>
</Page>